package com.ruoyi.web.controller.client.apply;

import com.ruoyi.framework.interceptor.MpAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysIncomingPersonalInformation;
import com.ruoyi.system.service.ISysIncomingPersonalInformationService;

/**
 * 产品申请—进件—个人信息Controller
 * 
 * @author ruoyi
 * @date 2025-05-07
 */
@RestController
@RequestMapping("/client/information")
public class SysIncomingPersonalInformationController extends BaseController
{
    @Autowired
    private ISysIncomingPersonalInformationService sysIncomingPersonalInformationService;

    /**
     * 获取产品申请—进件—个人信息详细信息
     */
    @MpAuthorize
    @GetMapping(value = "/{applyId}")
    public AjaxResult getInfo(@PathVariable("applyId") Long applyId)
    {
        return success(sysIncomingPersonalInformationService.selectSysIncomingPersonalInformationById(applyId));
    }

    /**
     * 新增产品申请—进件—个人信息
     */
    @MpAuthorize
    @Log(title = "产品申请—进件—个人信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysIncomingPersonalInformation sysIncomingPersonalInformation)
    {
        return toAjax(sysIncomingPersonalInformationService.insertSysIncomingPersonalInformation(sysIncomingPersonalInformation));
    }

    /**
     * 修改产品申请—进件—个人信息
     */
    @MpAuthorize
    @Log(title = "产品申请—进件—个人信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysIncomingPersonalInformation sysIncomingPersonalInformation)
    {
        return toAjax(sysIncomingPersonalInformationService.updateSysIncomingPersonalInformation(sysIncomingPersonalInformation));
    }
}
